package design.simdi.code.final_paper.core.entities;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 * @author Marius Dumitriu - (Jun 24, 2010 - 12:17:23 AM)
 * 
 */
@Entity
@Table(name = "sesiuni")
@AttributeOverrides( { @AttributeOverride(name = "id", column = @Column(name = "Sesiune_Id")) })
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Sesiune extends ApplicationEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	private String description;
	private Boolean defaulta;
	private Date dataStart;
	private Date dataStop;

	@Column(length = 250, nullable = false, name = "Name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(length = 1000, name = "Description")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(nullable = false, name = "Data_Start")
	public Date getDataStart() {
		return dataStart;
	}

	public void setDataStart(Date dataStart) {
		this.dataStart = dataStart;
	}

	@Column(nullable = false, name = "Data_Stop")
	public Date getDataStop() {
		return dataStop;
	}

	public void setDataStop(Date dataStop) {
		this.dataStop = dataStop;
	}

	public String toString() {
		return getName();
	}

	public void setDefaulta(Boolean defaulta) {
		this.defaulta = defaulta;
	}

	@Column(nullable = false, name = "Curenta")
	public Boolean isDefaulta() {
		return defaulta;
	}

}
